package com.firexxx.study.socket;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.Socket;

/**
 * @description: TODO
 * @author: zhuangzhang2
 * @date: 2021-02-09 10:28
 */
public class Client {

    public static void main(String[] args) throws IOException {
        Socket socket = new Socket();
        socket.bind(new InetSocketAddress("127.0.0.1", 8081));
        socket.connect(new InetSocketAddress("127.0.0.1", 8080));
        socket.getOutputStream().write(1);
        int a = socket.getInputStream().read();
        System.out.println(a);
        socket.close();
    }

}
